package SV_LDAP_ANON;

import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import java.util.Hashtable;

public class Vulnerable_02 {
    void test() throws NamingException {
        Hashtable<?, ?> env = null;
        DirContext ctx = new InitialDirContext(env);
        ctx.addToEnvironment(Context.SECURITY_AUTHENTICATION, "none");
        // another way of using anonymous authentication
        ctx.close();
    }
}
